package com.burstly.lib.network.request;

import com.burstly.lib.exception.BackgroundUncaughtExceptionHandler;
import com.burstly.lib.util.LoggerExt;
import com.burstly.lib.util.PrioritizedAsyncTask;

public abstract class SafeAsyncTask<T> extends PrioritizedAsyncTask<T>
{
  private static final LoggerExt LOG = LoggerExt.getInstance();
  private static final String TAG = "SafeAsyncTask";
  private String mBurstlyViewId;
  private String mHost;
  private String mOriginalName;
  private String mUri;
  private Thread mWorkerThread;

  private void setThreadName()
  {
    if (this.mWorkerThread != null)
      this.mWorkerThread.setName(this.mBurstlyViewId + " Host: " + this.mHost + ", Uri: " + this.mUri);
  }

  protected String getBurstlyViewId()
  {
    return this.mBurstlyViewId;
  }

  protected String getHost()
  {
    return this.mHost;
  }

  protected String getUri()
  {
    return this.mUri;
  }

  protected void onPostExecute(T paramT)
  {
    this.mWorkerThread.setName(this.mOriginalName);
    this.mWorkerThread = null;
  }

  protected T performInBackground()
  {
    this.mWorkerThread = Thread.currentThread();
    this.mOriginalName = this.mWorkerThread.getName();
    this.mWorkerThread.setUncaughtExceptionHandler(new BackgroundUncaughtExceptionHandler());
    LOG.logDebug("SafeAsyncTask", "Custom uncaughtExceptionHandler has been set.", new Object[0]);
    return null;
  }

  protected void setBurstlyViewId(String paramString)
  {
    this.mBurstlyViewId = paramString;
    setThreadName();
  }

  protected void setHost(String paramString)
  {
    this.mHost = paramString;
    setThreadName();
  }

  protected void setUri(String paramString)
  {
    this.mUri = paramString;
    setThreadName();
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.network.request.SafeAsyncTask
 * JD-Core Version:    0.6.2
 */